# 6  通过Python来实现显示给定文件夹下的所有文件和文件夹,以及时间，如果是文件，显示大小; 输出格式效果如下:

import os

all_files = os.listdir(os.curdir)

file_dict = dict()
file_dict1 = dict()

for each_file in all_files:

    if os.path.isfile(each_file):
            file_size = os.path.getsize(each_file)
            file_dict[each_file] = file_size
            file_time = os.path.getmtime(each_file)
            file_dict1[each_file] = file_time
for each in file_dict.items():
        print("{}大小{}".format(each[0], each[1]))
for each in file_dict1.items():
        print("{}时间{}".format(each[0], each[1]))


